﻿using System;
using System.Collections.Generic;
using OigSync.Infrastructure.Domain;

namespace OigSync.Model
{
    public class Order : EntityBase
    {
        public virtual String eBayUserID { get; set; }

        public virtual String OrderID { get; set; }

        public virtual String OrderSalesRecordNumber { get; set; }

        public virtual String UserID { get; set; }

        public virtual String BuyerFullName { get; set; }

        public virtual String BuyerAddress1 { get; set; }

        public virtual String BuyerAddress2 { get; set; }

        public virtual String BuyerCity { get; set; }

        public virtual String BuyerCounty { get; set; }

        public virtual String BuyerState { get; set; }

        public virtual String BuyerPhone { get; set; }

        public virtual String BuyerCountry { get; set; }

        public virtual String BuyerPostcode { get; set; }

        public virtual double PostageAndPackageCost { get; set; }

        public virtual double Insurance { get; set; }

        public virtual double TotalPrice { get; set; }

        public virtual String PaymentMethod { get; set; }

        public virtual String eBayPaymentStatus { get; set; }

        public virtual DateTime PaidonDate { get; set; }

        public virtual String PostageService { get; set; }

        public virtual String CompleteStatus { get; set; }

        public virtual String CheckoutStatus { get; set; }

        public virtual DateTime LastTimeModified { get; set; }

        public virtual IList<Transaction> Transactions { get; set; }

        public virtual IList<PayPalTransaction> PayPalTransactions { get; set; }

        public virtual DateTime ImportDate { get; set; }
    }

    public class Transaction : EntityBase
    {
        public virtual int ID { get; set; }

        public virtual String OrderLineItemID { get; set; }

        public virtual String SalesRecordNumber { get; set; }

        public virtual String ItemID { get; set; }

        public virtual String TransactionID { get; set; }

        public virtual String BuyerEmail { get; set; }

        public virtual String ItemTitle { get; set; }

        public virtual int Quantity { get; set; }

        public virtual double SalePrice { get; set; }

        public virtual double TotalPrice
        {
            get { return Quantity * SalePrice; }
        }

        public virtual double FinalValueFee { get; set; }

        public virtual DateTime InvoiceDate { get; set; }

        public virtual String IncludedVATRate { get; set; }

        public virtual DateTime SaleDate { get; set; }

        public virtual String CustomLable { get; set; }

        public virtual String PrivateNotes { get; set; }

        public virtual String VariationSKU { get; set; }

        public virtual String VariationTitle { get; set; }

        public virtual String VariationViewItemURL { get; set; }

        public virtual String BuyerSelectedShipping { get; set; }

        public virtual int FeedbackScore { get; set; }

        public virtual double PositiveFeedbackPercent { get; set; }

        public virtual String Platform { get; set; }

        public virtual String Site { get; set; }

        public virtual IList<Variation> Variations { get; set; }
    }

    public class PayPalTransaction
    {
        public virtual int ID { get; set; }

        public virtual String eBayUserID { get; set; }

        public virtual String OrderID { get; set; }

        public virtual String TransactionID { get; set; }

        public virtual DateTime ExternalTransactionTime { get; set; }

        public virtual double FeeOrCreditAmount { get; set; }

        public virtual double PaymentOrRefundAmount { get; set; }
    }

    public class Variation
    {
        public virtual int ID { get; set; }

        public virtual String VariationSKU { get; set; }

        public virtual String VariationName { get; set; }

        public virtual string VariationValue { get; set; }

    }
}
